﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZLDC.Common.Estate;
using System.Data;

namespace ZLDC.Topo.BLL.Estate
{
                public class PriceReductionBLL
    {
                                                                public static string p_v_priceReduction_list_table(int page, int pagesize, string condition)
        {
            DataTable dt = null;
            int total = 0;                       int pageall = 0;         
            using (_Database db = new _Database("estate"))
            {
                dt = ZLDC.DAL.Estate.PriceReductionDAL.p_v_priceReduction_list_table(page, pagesize, condition, ref total, db);
            }

            pageall = _Utility.GetPageAll(pagesize, total);      
            _Json json = new _Json(dt);
            return "{page:{currentpage:'" + page + "',pagesize:'" + pagesize + "',total:'" + total + "',pageall:'" + pageall + "'},record:" + json.ToJson() + "}";
        }

                                                        public static void p_priceReduction_add(int housingId, float price_new, float leasePrice_new)
        {
            using (_Database db = new _Database("estate"))
            {
                ZLDC.DAL.Estate.PriceReductionDAL.p_priceReduction_add(housingId, price_new, leasePrice_new, db);
            }
        }

    }
}
